package com.serviceprovider.business.module.sp.preferences.dao.impl;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.sp.preferences.model.Preferences;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

//~--- JDK imports ------------------------------------------------------------

import java.sql.ResultSet;
import java.sql.SQLException;

public class PreferencesMapper implements ParameterizedRowMapper<Preferences> {
    @Override
    public Preferences mapRow(ResultSet rs, int rowIndex) throws SQLException {
        Preferences result = new Preferences();

        result.setId(rs.getInt("id"));
        result.setId(rs.getInt("user_id"));
        result.setBonus(rs.getInt("bonus"));
        result.setCustomFee(rs.getInt("custom_fee"));
        result.setComission(rs.getInt("commission"));

        return result;
    }
}



